/**
 * @(#)ChannelApkLimitDAOImpl.java 2016年10月28日
 * Copyright(C) 2015 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao.impl;


import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.dao.IChannelApkLimitDAO;
import org.jsbd.boss.domian.ChannelApkConfigTimeModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.hziee.common.dbroute.BaseDAO;
import edu.hziee.common.lang.DateUtil;

/**
 * TODO 请加入本类的说明
 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
 * @version 1.0.0
 */
public class ChannelApkLimitDAOImpl extends BaseDAO  implements IChannelApkLimitDAO {
	public static final Logger LOGGER = LoggerFactory.getLogger(ChannelApkLimitDAOImpl.class);
	

	@Override
	public List<ChannelApkConfigTimeModel> selectChannelApkConfigTimeModel(String mark,String type) {
		Map<String, String> params = new HashMap<String, String>();
		params.put("mark", mark);
		params.put("type", type);
		params.put("currentDate",DateUtil.formatDate(new Date(), "yyyyMMdd"));
		return super.queryForList("qy_channelapk_limit.GET_CHANNELAPK_TIMEMODEL_BYMARK",params);
	}
	@Override
	public void saveChannelApkConfigTimeModel(List<ChannelApkConfigTimeModel> list) {
		for(ChannelApkConfigTimeModel temp: list)
		super.insert("qy_channelapk_limit.INSERT_QY_CHANNELAPK_TIME_MODEL",temp);
	}
	@Override
	public void saveChannelApkConfigTimeModel(ChannelApkConfigTimeModel model) {
		super.insert("qy_channelapk_limit.INSERT_QY_CHANNELAPK_TIME_MODEL",model);
	}
	@Override
	public void deleteChannelApkConfigTimeModel(String mark,String type) {
		Map<String, String> params = new HashMap<String, String>();
		params.put("mark", mark);
		params.put("type", type);
		super.insert("qy_channelapk_limit.DELETE_CHANNELAPK_TIMEMODEL_BYMARK",params);
	}
	/* (non-Javadoc)
	 * @see org.jsbd.boss.dao.IChannelApkLimitDAO#updateTimeModel(java.lang.String, int)
	 */
	@Override
	public int updateTimeModel(ChannelApkConfigTimeModel model) {
		return super.update("qy_channelapk_limit.UPDATE_TIME_MODEL", model);
	}

	
}
